package java8;

import java8.pojo.IEmail;
import java8.pojo.IMessage;
import java8.pojo.Sender;

public class InterfaceSample {

    public static void main(String[] args) {
        Sender sender = new Sender();
        // 通过实例对象调用接口默认方法
        // 输出: sending email: Hello Email
        sender.sendEmail();
        // 输出: sending message: Hello Message
        sender.sendMessage();
        // 输出: Message Title
        System.out.println(sender.getTitle());
        // 通过接口调用静态方法
        // 输出: Message Body
        System.out.println(IMessage.getBody());
        // 输出: Email Body
        System.out.println(IEmail.getBody());
    }

}